package org.mespilus.mespilusweb.datalayer.productmanagement;

import java.util.HashMap;
import java.util.List;

import javax.jdo.annotations.EmbeddedOnly;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import org.mespilus.mespilusweb.datalayer.usermanagement.Provider;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Producer {
	
	@PersistenceCapable
	@EmbeddedOnly
	public static class ProductDetails{
		@Persistent
		protected float price;

		public ProductDetails(float price) {
			super();
			this.price = price;
		}

		public float getPrice() {
			return price;
		}

		public void setPrice(float price) {
			this.price = price;
		}
	}
	
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	protected int idProvider;
	
	@Persistent
	protected List<Provider> contactPersons;
	
	@Persistent
	protected CategoryProvider categoryProvider;
	
	@Persistent
	protected HashMap<Product, ProductDetails> products;
}
